import React, { useState } from 'react'
// usecontext
/* 函数式组件 */
function Test0201() {
    const listobj = [
        { name: "张三", content: "水电费" },
        { name: "李四", content: "222" },
    ]
    const [list, setList] = useState(listobj)
    return (
        <div>
            用户名 <br />
            <input type="text" /> <br />
            评论 <br />
            <input type="text" /> <br />
            <button>提交</button> <br />
            评论回复 <br />
            <ul>
                {
                    list.map((item,i) => {
                        return (
                            <li key={i}>
                                <div>{item.name}---- <button>删除</button> </div>
                                <div>{item.content}</div>
                            </li>
                        )
                    })
                }

            </ul>
        </div>
    )
}
export default Test0201
